import request from '@/utils/request'

// 创建工单
export function createPropertyWorkOrder(data) {
  return request({
    url: '/ipark/property-work-order/create',
    method: 'post',
    data: data
  })
}

// 更新工单
export function updatePropertyWorkOrder(data) {
  return request({
    url: '/ipark/property-work-order/update',
    method: 'put',
    data: data
  })
}

// 删除工单
export function deletePropertyWorkOrder(id) {
  return request({
    url: '/ipark/property-work-order/delete?id=' + id,
    method: 'delete'
  })
}

// 获得工单
export function getPropertyWorkOrder(id) {
  return request({
    url: '/ipark/property-work-order/get?id=' + id,
    method: 'get'
  })
}

// 获得工单分页
export function getPropertyWorkOrderPage(params) {
  return request({
    url: '/ipark/property-work-order/page',
    method: 'get',
    params
  })
}
// 导出工单 Excel
export function exportPropertyWorkOrderExcel(params) {
  return request({
    url: '/ipark/property-work-order/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}